package org.s3.project.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.s3.project.entity.Favorites;
import org.s3.project.mapper.FavoritesMapper;
import org.s3.project.service.FavoritesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ljh
 * @version 1.0
 * @Description
 * @date 2025/2/18 09:13
 */
@Service
public class FavoritesServiceImpl extends ServiceImpl<FavoritesMapper, Favorites> implements FavoritesService {
    @Autowired
    private FavoritesMapper favoritesMapper;

    @Override
    public int getFavoritesAdd(Favorites favorites) {
        return favoritesMapper.getFavoritesAdd(favorites);
    }

    @Override
    public List<Favorites> selectFavorites(int id) {
        return favoritesMapper.selectFavorites(id);
    }

    @Override
    public Integer deleteFavorites(Integer user_id, Integer dish_id) {
        return favoritesMapper.deleteFavorites(user_id,dish_id);
    }

    @Override
    public Integer selectFavoritesByUserIdAndDishId(Favorites favorites) {
        return favoritesMapper.selectFavoritesByUserIdAndDishId(favorites);
    }

    @Override
    public List<Favorites> selectFavoritesCount(int user_id) {
        return favoritesMapper.selectFavoritesCount(user_id);
    }

    @Override
    public List<Favorites> getFavoritesId(int user_id) {
        return favoritesMapper.getFavoritesId(user_id);
    }

}
